<?php
error_reporting(E_ALL); 
ini_set("display_errors", 1); 
defined('_JEXEC') or die('Restricted access');

JTable::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR.DS.'tables');

require_once JPATH_COMPONENT.DS.'controller.php';

if (version_compare(JVERSION, '2.5.0', 'ge')) {
    JHtml::_('behavior.framework', true);
} else {
    JHtml::_('behavior.mootools');
}
$document =& JFactory::getDocument();
//$document->addScript('components'.DS.'com_docario'.DS.'assets'.DS.'admin.js');
$document->addStyleSheet('components'.DS.'com_docario'.DS.'assets'.DS.'css'.DS.'docario.css');

require_once(JPATH_COMPONENT_ADMINISTRATOR . DS . 'helpers' . DS . 'filetools.php');

if ($controller = JRequest::getWord('controller')) {
	$path = JPATH_COMPONENT.DS.'controllers'.DS.$controller.'.php';
	if (file_exists($path)) {
		require_once $path;
	} else $controller = '';
}
$classname = 'DocarioController'.$controller;
$controller = new $classname();
$controller->execute( JRequest::getVar('task'));
$controller->redirect();
?>
